HAL RAMCFG migration: List of applicable concepts

This section provides information about the HAL RAMCFG applicable architecture concepts.

Concepts for RAMCFG

Concept

Description

Separation of initialization and configuration functions

In HAL2, the handle has been removed and direct instance-based control functions are used instead. Consequently, the HAL_RAMCFG_Init function is no longer available.

Remove MspInit and MspDeInit callbacks

HAL_RAMCFG_MspInit and HAL_RAMCFG_MspDeInit are no longer available, they are replaced by a user sequence to initializes and configures the RAMCFG.

Individual callback registration APIs replace global register and unregister functions

The callback registration is handled by specific functions for each RAMCFG event. These functions are used to register callback functions for different RAMCFG events.

HAL implementation with LL inline functions

HAL RAMCFG APIs now rely on LL APIs rather than performing direct register access.

Define statements and enumerations redirected to LL equivalents

HAL RAMCFG define statements and enumerations are based on LL define statements.

Removal of hardware-related macros in HAL2

All hardware macros have been removed from the HAL RAMCFG driver, and equivalent services are ensured through the LL APIs.

Revised and optimized HAL API status returns

HAL RAMCFG APIs return status using the type hal_status_t.

Revised and optimized HAL error management

Involves redesigning the error handling mechanisms within the HAL to improve the detection, reporting, and handling of errors. This rework aims to provide more detailed and consistent error information: HAL_RAMCFG_ECC_NONE, HAL_RAMCFG_ECC_SINGLE and HAL_RAMCFG_ECC_DOUBLE.

Replaced TypeDef suffix with _t in type names

All TypeDef parts of the HAL RAMCFG driver have been removed and replaced by _t.

Replaced nonmodifiable pointers with const keywords

Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable.

Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels.

Finite parameters (including RAMCFG instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety.

Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions).

All HAL RAMCFG functions start with HAL_RAMCFG. All HAL RAMCFG enumerations and structures start with hal_ramcfg.

Other HAL RAMCFG changes

Concept

Consideration

Remove the handle and use the instance as a parameter for HAL functions.

The handle and initialization structures were removed, and the instance passed directly to the various RAMCFG functions is now used instead.

Add LL Driver

The RAMCFG driver is straightforward to use; an LL interface is available for advanced/expert usage.

Add an API that enables ECC in interrupt mode and simultaneously activates notifications, instead of using a separate API to enable notifications.

This change implies: Removal of the following APIs:

  • HAL_RAMCFG_EnableNotification

  • HAL_RAMCFG_DisableNotification

Addition of the following APIs:

  • HAL_RAMCFG_ECC_Enable

  • HAL_RAMCFG_ECC_Enable_IT

  • HAL_RAMCFG_ECC_Disable